#pragma once

#include "ISpace.h"
#include "ISpacePartition.h"
#include "STLInclude.h"

class SpaceImp: public ISpace
{
public:
	SpaceImp();
	virtual ~SpaceImp();
	
	// return number of meshes in the scene
	virtual size_t ClearAllMeshes();
	virtual size_t AddMesh(const TCRTMesh* pMesh);
	virtual size_t GetNumberOfMeshes() const;
	virtual const TCRTMesh* GetMesh(size_t index) const;

	virtual bool BuildPartition();

	virtual ITraceResult* TraceRay(RAY* pRay, TraceType traceType);

protected: 
	void CleanMembers();

	vector<TCRTMesh*> mMeshes;
	ITraceResult* mpResult;
	ISpacePartition* mpPartition;
};